﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Simulacion.Fruits
{
    class Mango : Fruit
    {
        private double pLowMi, pLowSigma, pJulMi, pJulSigma, pJulGamma, pHighMi, pHighSigma, pHighGamma;

        public Mango()
        {
            _life = 30;
            this.pLowMi = 3.7075;
            this.pLowSigma = 0.96057;
            this.pJulMi = -1.3353;
            this.pJulSigma = 0.56871;
            this.pJulGamma = 2.1933;
            this.pHighMi = 1.8441;
            this.pHighSigma = 0.14797;
            this.pHighGamma = 0;

            this._pLowMin = 1.4;
            this._pLowMax = 6.0;
            this._pHighMin = 4.75;
            this._pHighMax = 10.0;
            this._pJulMin = 2.25;
            this._pJulMax = 2.9;
        }

        protected override double GetVarPeriodLow()
        {
            return Distributions.Normal.GetDistributionValue(_pLowMin, _pLowMax, pLowMi, pLowSigma);
        }

        protected override double GetVarPeriodHigh()
        {
            return Distributions.Lognormal3P.GetDistributionValue(_pHighMin, _pHighMax, pHighMi, pHighSigma, pHighGamma);
        }

        protected override double GetVarPeriodJuly()
        {
            return Distributions.Lognormal3P.GetDistributionValue(_pJulMin, _pJulMax, pJulMi, pJulSigma, pJulGamma);
        }

        protected override double GetFPeriodLow(double x)
        {
            return Distributions.Normal.fNormal(x, pLowMi, pLowSigma);
        }

        protected override double GetFPeriodHigh(double x)
        {
            return Distributions.Lognormal3P.fLognormal3P(x, pHighMi, pHighSigma, pHighGamma);
        }

        protected override double GetFPeriodJuly(double x)
        {
            return Distributions.Lognormal3P.fLognormal3P(x, pJulMi, pJulSigma, pJulGamma);
        }

        public double PLowMi
        {
            get { return pLowMi; }
            set { pLowMi = value; }
        }

        public double PLowSigma
        {
            get { return pLowSigma; }
            set { pLowSigma = value; }
        }

        public double PJulMi
        {
            get { return pJulMi; }
            set { pJulMi = value; }
        }

        public double PJulSigma
        {
            get { return pJulSigma; }
            set { pJulSigma = value; }
        }

        public double PJulGamma
        {
            get { return pJulGamma; }
            set { pJulGamma = value; }
        }

        public double PHighMi
        {
            get { return pHighMi; }
            set { pHighMi = value; }
        }

        public double PHighSigma
        {
            get { return pHighSigma; }
            set { pHighSigma = value; }
        }

        public double PHighGamma
        {
            get { return pHighGamma; }
            set { pHighGamma = value; }
        }
    }
}
